#include <iostream>

namespace bga
{

template <typename T>
Scoped_Ptr<T>::Scoped_Ptr(T* pPtr) : ptr(pPtr)
{
}

template <typename T>
Scoped_Ptr<T>::~Scoped_Ptr()
{
    if(this->ptr)
    {
        delete this->ptr;
        this->ptr = NULL;
    }
}


template <typename T>
void Scoped_Ptr<T>::reset(T* pPtr)
{
    if(this->ptr)
    {
        delete this->ptr;
        this->ptr = NULL;
    }
    this->ptr = pPtr;
}

template <typename T>
T* Scoped_Ptr<T>::get() const
{
    return this->ptr;
}

template <typename T>
T* Scoped_Ptr<T>::operator->() const
{
    return this->ptr;
}

template <typename T>
T& Scoped_Ptr<T>::operator*() const
{
    return *(this->ptr);
}

template <typename T>
bool Scoped_Ptr<T>::operator!() const
{
    return !(this->ptr);
}

}
